/*
 * Copyright 2007-2008 Andrew O'Malley
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


package ws.quokka.plugin.lifecycle;


/**
 *
 */
public class MockLifeCyclePlugin extends LifeCycleImpl {
    //~ Methods --------------------------------------------------------------------------------------------------------

    public void clean() {
        verify(LifeCycle.CLEAN);
    }

    private void verify(String target) {
        if (!getResources().getTargetName().equals(target)) {
            throw new RuntimeException("Lifecycle method expected a target of " + target + ", but was "
                + getResources().getTargetName());
        }
    }

    public void generateSources() {
        verify(LifeCycle.GENERATE_SOURCES);
    }

    public void processSources() {
        verify(LifeCycle.PROCESS_SOURCES);
    }

    public void generateResources() {
        verify(LifeCycle.GENERATE_RESOURCES);
    }

    public void processResources() {
        verify(LifeCycle.PROCESS_RESOURCES);
    }

    public void compile() {
        verify(LifeCycle.COMPILE);
    }

    public void processCompiled() {
        verify(LifeCycle.PROCESS_COMPILED);
    }

    public void instrumentCompiled() {
        verify(LifeCycle.INSTRUMENT_COMPILED);
    }

    public void generateTestSources() {
        verify(LifeCycle.GENERATE_TEST_SOURCES);
    }

    public void processTestSources() {
        verify(LifeCycle.PROCESS_TEST_SOURCES);
    }

    public void generateTestResources() {
        verify(LifeCycle.GENERATE_TEST_RESOURCES);
    }

    public void processTestResources() {
        verify(LifeCycle.PROCESS_TEST_RESOURCES);
    }

    public void testCompile() {
        verify(LifeCycle.TEST_COMPILE);
    }

    public void test() {
        verify(LifeCycle.TEST);
    }

    public void packageIt() {
        verify(LifeCycle.PACKAGE);
    }

    public void integrationTest() {
        verify(LifeCycle.INTEGRATION_TEST);
    }

    public void verify() {
        verify(LifeCycle.VERIFY);
    }

    public void install() {
        verify(LifeCycle.INSTALL);
    }
}
